<div class="row"> <h3 class="page-header">节点管理</h3></div>
<div class="row">
    <div class="panel panel-default">
        <div class="panel-body">
        	<label><a class="btn btn-primary" href="{:U('Node/add')}">添加节点</a></label>
            <div class="table-responsive">
                <table class="table table-striped table-bordered table-hover">
                    <thead>
                    	<tr>
                            <th>节点名称</th>
                            <th>节点路径</th>
                            <th width="75">排序</th>
                            <th width="75">状态</th>
                            <th width="120">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <volist name="list" id="list">
                            <tr>
                                <switch name='list.num'>
                                    <case value='3'><assign name='str' value='&nbsp;|&nbsp;&nbsp;|&nbsp;&nbsp;|-&nbsp;'/></case>
                                    <case value='2'><assign name='str' value='&nbsp;|&nbsp;&nbsp;|-&nbsp;'/></case>
                                    <default/><assign name='str' value='&nbsp;|-&nbsp;'/>
                                </switch>
                                <td>{$str}{$list.title}</td>
                                <td>{$str}{$list.name}</td>
                                <td><input class="setSort" type="text" size="5" data-url="{:U('Node/setSort?id='.$list['id'])}" value="{$list.sort}"></td>
                                <td>
                                    <button class='btn <eq name="list.status" value="1">btn-primary<else />btn-default</eq> btn-sm setStatus' type="button" data-url='{:U("Node/setStatus?id=".$list["id"])}' data-status="{$list.status}"><eq name="list.status" value='1'>启用<else />禁用</eq></button>
                                </td>
                                <td>
                                    <a class="btn-sm btn btn-default" href='{:U("Node/edit?id=".$list["id"])}'>修改</a>
                                    <button data-url='{:U("Node/del?id=".$list["id"])}' class="btn-sm btn btn-default delBtn" type="button">删除</button>
                                </td>
                            </tr>
                        </volist>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
	$(function(){
		$('.open').click(function(){
			if($(this).data('open') == 0){
				$(this).removeClass('fa-minus').addClass('fa-plus');
				$('.level'+$(this).data('id')).addClass('hide');
			}else{
				$(this).removeClass('fa-plus').addClass('fa-minus');
				$('.level'+$(this).data('id')).removeClass('hide');
			}
			$(this).data('open', $(this).data('open') == 1 ? 0 : 1);
		});
	})
</script>